package selfStudy.demo;

import java.io.*;
import java.util.Properties;

//properties对象
public class Test {
    public static void main(String[] args) throws IOException {
        //Properties是一个map集合
        Properties pp = new Properties();
        // void load
        //InputStreamReader isr = new InputStreamReader(new FileInputStream("day12\\Test.properties"));
        FileReader fr = new FileReader("day12\\Test.properties");
        //pp.load(isr);
        pp.load(fr);
        System.out.println(pp);


        //void store
       // OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("day12\\Test1.properties"));

        FileWriter fw = new FileWriter("day12\\Test1.properties");
        //pp.store(osw, "utf-8");
        pp.store(fw, "utf-8");


        //释放资源

        //isr.close();
        //osw.close();

        fr.close();
        fw.close();

    }
}
